Conversation
Contributor
Action items
|
Contributor
Action items
|
Contributor
Action items
|
Contributor
Action items
|
Contributor
Action items
|
Contributor
Action items
|
Contributor
|
No actionable findings. |
Contributor
|
No actionable findings. |
Contributor
|
No actionable findings. |
Contributor
Action items
|
Contributor
Action items
|
Contributor
Action items
|
Contributor
Action items
|
Contributor
Action items
|
Contributor
Action items
|
Contributor
Action items
|
Contributor
Action items
|
Reads the public /v1/models catalog, syncing price and hosted-model context. Creates and removes models, with nearai-curation.ts recording how each route controls reasoning and holding back anything it has no entry for.
neo-sky
force-pushed
the
feat/nearai-sync
branch
from
September 16, 2026 20:25
f2fb54a to
7143e6a
Compare
Contributor
|
No actionable findings. |
Adds the eighteen models NEAR AI serves that models.dev did not carry, removes GLM-5.1 after its 2026-09-11 retirement, and narrows existing entries to the inputs the gateway accepts.
neo-sky
force-pushed
the
feat/nearai-sync
branch
from
September 16, 2026 20:44
7143e6a to
c0b126a
Compare
Contributor
|
No actionable findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
nearaisync provider that reads the public/v1/modelscatalog oncloud-api.near.ai. The endpoint needs no credential, so this needs no repositorysecret and no change to
sync-models.yml: the sync matrix is built frombun models:sync --list-providers, so registering the provider is the wiring.The provider creates, updates and removes, so
providers/nearaitracks what thehost actually serves. This run adds 18 models, updates 1 and removes 1.
What the sync takes, and what it does not
The endpoint is authoritative for price and for catalog membership. Its other
fields are not, and each of these was checked against live requests rather than
read off the response. Prices come from
https://cloud-api.near.ai/v1/models, which publishespricing.inputandpricing.outputas dollars per million tokens andpricing.input_cache_readasdollars per token, scaled here and rounded because the endpoint returns artifacts
such as
1.4000000000000001.max_output_lengthis advisory and not enforced. Onzai-org/GLM-5.1-FP8itreports 16384, while
max_tokensof 16384, 40000 and 131072 were all acceptedand only 202752 and above were rejected, with "Requested token count exceeds the
model's maximum context". The binding limit is the context window, so
limit.outputis never synced.context_lengthis the servingmax_model_lenonly whereowned_byisnearai. On relayed routes it is rounded:openai/gpt-4.1reports 1000000against the lab entry's 1047576. So context is synced for hosted models only,
and taken as the lower of the two values. Created files inherit limits from the
lab entry rather than taking them from the host, so a create never publishes a
cap the lab does not carry.
supported_featuresis wrong in both directions. It listsreasoningfor theClaude relay routes, where
thinking.typeandreasoning_effortare rejectedand the accepted
reasoningobject returns noreasoning_content; it omitsreasoningfor others that plainly reason. No capability is taken from it.input_modalitiesadvertises image input for the Moonshot routes, which rejectit, and for
x-ai/grok-4.6, which fails the request outright. It also reportsan
embeddingmodality the schema has no value for.How created models get their reasoning controls
/v1/modelssays whether a model reasons but not how a caller turns it on, off orup, and the answer belongs to the route rather than the model, so the same lab
model is a toggle on one host and inert on another. Lab entries under
models/carry no
reasoning_options, so it cannot be inherited either.packages/core/src/sync/providers/nearai-curation.tsrecords that answer permodel, along with the evidence for it, and a model is created only once it has an
entry there. The evidence is written as the created file's leading comment, so
every toggle carries its wire path and every
[]carries the measurement behindit.
[]here means the route was probed and exposes no caller control, never thatnobody looked:
anthropic/claude-opus-5acceptsreasoning.effortand returnsidentical completion_tokens ranges at every level across three samples, while
thinking.typeandreasoning_effortare rejected outright. Effort levels arerecorded as a set and never as an ordering, because on
deepseek-ai/DeepSeek-V4-Flashhighreasons least of the four.The OpenAI routes pass
reasoning_effortthrough to OpenAI, perhttps://docs.near.ai/cloud/reasoning-models, and take their level set from thematching
providers/openai/models/entry.Every live model with no entry is held back and reported by name rather than
published with a guess, whether or not
supported_featurescalls it a reasoner,because that field omits reasoning for routes that plainly reason. One model is
currently held back:
deepseek/deepseek-v4.1-flash.gemini-3.8-flashis created withreasoning_options = []on a live measurement:reasoning_effortandreasoning.effortare both accepted, three samples per levelat temperature 0 leave the completion length inside the no-parameter spread, and no
reply carries
reasoning_content. The five Gemini routes already published here areleft exactly as they are. They were never probed on this host, and the sibling
measurement is suggestive rather than conclusive, so this pull request does not
change them in either direction.
Why this carries 18 models, and what happens after it
This is the only pass that needs to be this size.
classifyAutoMergecaps a syncrun at
MAX_CREATED_MODELS = 10and the backlog is 18, so the nightlyautomation/sync-models-nearairun cannot land it however long it is left. Thefirst batch has to arrive in a reviewed pull request. After it the catalog is
level, and every later run is a delta of nought to two models.
From then on this runs on your infrastructure, with no credential of ours:
reasoning,reasoning_options,interleavedandbase_modeluntouched, soreasoningChangedis false and the reasoning check does not apply.records it, because the sync refuses to guess.
One gap is worth naming rather than leaving to be discovered. A newly created
reasoning model is unsafe to auto-merge unless its provider is listed in
REVIEWED_REASONING_PROVIDERS, andnearaiis not, so a new model would open async pull request and then wait for a human even once its controls are recorded.
Adding
nearaito that set would close it, and we are glad to do that here orleave it alone, whichever you prefer. The case for it is that this provider cannot
create a reasoning model with guessed controls, because
translateModelthrowsunless the model has a curation entry, so anything it creates carries measured
reasoning_optionsand the measurement is in the file. The case against is that itis your trust list rather than ours, and everything else here works without it.
Safety
model, and a truncated list that still parses would otherwise be
indistinguishable from a mass retirement. The live list carried 52 models when
this was written.
trackMissingModels: false: remote-only models are listed in the sync noticerather than filed as one issue each.
aborting the run for every other model.
repository is the record and corrections are reviewed here.
Entries created here publish the inputs the route accepts rather than the lab's
superset. A
type: "file"content part fails schema deserialisation on everyroute, so no entry this pull request adds lists
pdf, and none inheritsvideoor
audiothe endpoint does not report. Fifteen entries already published underproviders/nearaistill inherit those modalities from their lab entries.Narrowing them touches files this change does not otherwise go near, so it is
left out rather than folded in.
The one removal
zai-org/GLM-5.1-FP8is removed. It has been absent from/v1/modelssince2026-09-11, when its production completion endpoint was retired. The curation file
records that removal as deliberate so a later run does not read it as a gap.
One thing worth knowing about the model IDs
NEAR AI spells the same lab both ways:
Qwen/Qwen3.8-27Balongsideqwen/qwen3.7-max. Since the filename is the model ID and the ID has to matchwhat the host accepts,
providers/nearai/modelsnow holds both aQwenand aqwendirectory. Those are distinct paths in git but the same directory on acase-insensitive filesystem, where a tree walk would attribute a file to whichever
spelling was created first. Renaming either one would publish an ID the host does
not serve, so the casing follows the host. Flagging it because it is the only such
pair in the repository.
Checks
bun validate- exit 0bun install && bun validate && bun run testinpackages/sdk, matchingvalidate.yml- 23 passed, typecheck cleanbun test packages/core/test/nearai.test.ts- 26 passedbun models:sync nearai --dry-run- 18 created, 1 updated, 1 removed,30 unchanged
bun models:sync nearairun twice - the second run reports 0 created, 0 updated,0 removed, 49 unchanged
bun test- the same 4 unrelated failures reproduce on a cleandevcheckout at
76571c179